<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function login(){
			
			  var $uname=uname.value;
				var $upwd=upwd.value;
				
				if(!$uname){alert("请输入用户名");return}
				if(!$upwd){alert("请输入用户名");return}
				var xhr=new XMLHttpRequest();
				xhr.onreadystatechange=function(){
					if(xhr.readyState==4 && xhr.status==200){
					 var 	r=xhr.responseText;
					 
					 if (r==1){
					 	d1.innerHTML="登录成功";
						location.href="http://127.0.0.1:8080/_v1list.html";
					 }else{
					 	d1.innerHTML="登录失败";
					 }
					      
					}
				}
				xhr.open("get",`/pro/v1/login?uname=${$uname}&upwd=${$upwd}`,true);
				xhr.send();
			}
		</script>
	</head>
	<body>
		<input type="text" id="uname"><br>
		<input type="text" id="upwd"><br>
		<button onclick="login()">登录</button>
		<div id="d1"></div>
	</body>
</html>
